package com.xmall.pethouse_api.service.impl;

import com.xmall.pethouse_api.mapper.OrderMapper;
import com.xmall.pethouse_api.pojo.entity.Order;
import com.xmall.pethouse_api.pojo.vo.OrderVO;
import com.xmall.pethouse_api.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> findByUserId(Long userId) {
        return orderMapper.findByUserId(userId);
    }

    @Override
    public List<OrderVO> findOrderVOByUserId(Long userId) {
        return orderMapper.findOrderVOByUserId(userId);
    }

    @Override
    public void createOrder(Order order) {
        orderMapper.insert(order);
    }
} 